<template>
  <div>
    <el-button-group style="position: relative;left:2rem;">
      <el-tooltip class="item" effect="dark" content="用于发布上级通知和工作清单等" placement="top-end">
        <el-button plain icon="el-icon-s-promotion" @click="dialogNotice = true;isNotice = true">发布通知</el-button>
      </el-tooltip>
      <el-tooltip class="item" effect="dark" content="用于发布法规文件资料等" placement="top-end">
        <el-button plain icon="el-icon-upload" @click="dialogNotice = true;isNotice = false">上传文件</el-button>
      </el-tooltip>
    </el-button-group>
    <div style="height: 50rem; padding: 24px;">
      <el-col :span="12" border>
        <!-- 通知信息 -->
        <Notice ref="Notice" />
      </el-col>
      <el-col :span="12" border>
        <Document ref="Document" />
      </el-col>
    </div>
    <!-- 提交通知的dialog -->
    <Publish :show-dialog-visible.sync="dialogNotice" :is-notice.sync="isNotice" @requireFresh="requireFresh" />
  </div>
</template>
<script>
export default {
  name: 'DocumentAndNotice',
  components: {
    Publish: () => import('./notice/publish'),
    Notice: () => import('./notice/index'),
    Document: () => import('./document/index')
  },
  data: () => ({
    dialogNotice: false,
    isNotice: null,
    dialogFileUpload: false,
    reverse: true,
    noticeForm: {},
    page: { pageIndex: 0, pageSize: 10 },
    totalCount_notice: 0,
    noticeData: [],
    documentList: []
  }),
  mounted() {
    this.$store.dispatch('notice/initDictionary')
  },
  methods: {
    requireFresh() {
      if (this.isNotice) this.$refs.Notice.refresh()
      else this.$refs.Document.refresh()
    }
  }
}
</script>

<style>

.block {
  padding: 30px;
  border: 2px solid #eff2f6;
  width: 100%;
  height: 50rem;
  box-sizing: border-box;
}
._blank {
  font: 12px/22px 'SimSun', 'Arial Narrow';
  list-style: none;
  line-height: 24px;
  font-size: 14px;
  color: #1f3b7b;
  text-decoration: none;
  outline: none;
}
</style>
